For an electrical connector matable with a mating electrical connector, a locking device that locks the electrical connector with the mating electrical connector is generally formed on the electrical connector to stabilize the electrical connection. Because the components of the electrical connector are subject to impact during use, however, the locking device is apt to be damaged and can fail to implement locking and release of the locking. Furthermore, the locking device may break and fail due to the impact, leading to malfunction of the electrical connector.